import Vue from 'vue'
import VueRouter from 'vue-router'

import Msite from '@/pages/Msite/Msite'
import Order from '@/pages/Order/Order'
import Profile from '@/pages/Profile/Profile'
import Search from '@/pages/Search/Search'
import Login from '@/pages/Login/Login'
import Shop from '@/pages/Shop/Shop'
import ShopGoods from '@/pages/Shop/ShopGoods/ShopGoods'
import ShopInfo from '@/pages/Shop/ShopGoods/ShopInfo'
import ShopRatings from '@/pages/Shop/ShopGoods/ShopRatings'

const routes = [
  {
    path: '/',
    component: Msite,
    meta: {
      footerBar: true
    },
    name: '首页'
  },
  {
    path: '/order',
    component: Order,
    meta: {
      footerBar: true
    },
    name: '订单'
  },
  {
    path: '/search',
    component: Search,
    meta: {
      footerBar: true
    },
    name: '搜索'
  },
  {
    path: '/profile',
    component: Profile,
    meta: {
      footerBar: true
    },
    name: '我的'
  },
  {
    path: '/login',
    component: Login,
    name: '登录/注册'
  },
  {
    path: '/shop',
    component: Shop,
    children: [
      {
        path: '/shop/goods',
        component: ShopGoods
      },
      {
        path: '/shop/ratings',
        component: ShopRatings
      },
      {
        path: '/shop/info',
        component: ShopInfo
      }
    ]
  }
]

Vue.use(VueRouter)
export { routes }
export default new VueRouter({
  routes: routes
})
